package test;

import java.math.BigDecimal;
import java.util.Scanner;

/**
 * Created by MtRider on 2021/10/24 12:44
 */
public class CaculateSalary {
    private double rate;
    private double salary;
    private int year;


    public double getRate() {
        return rate;
    }

    public void setRate(double rate) {
        this.rate = rate;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public CaculateSalary( double salary,double rate, int year) {
        this.rate = rate;
        this.salary = salary;
        this.year = year;
    }
    public void calculate(CaculateSalary caculateSalary){
        BigDecimal sum = new BigDecimal("0");
        BigDecimal currentYearSalary = new BigDecimal(caculateSalary.getSalary());
        BigDecimal mut=new BigDecimal(caculateSalary.getRate()+1);
        int year=caculateSalary.getYear();
        for (int i = 0; i < year; i++) {
            sum=sum.add(currentYearSalary);
            currentYearSalary=currentYearSalary.multiply(mut);
        }
        System.out.println(currentYearSalary);
        System.out.println(sum);
    }
/*public void calculate(CaculateSalary caculateSalary){
    String currentYearSalaryString="";
    String sumString="";
    double sum=0;
    double currentYearSalary=caculateSalary.getSalary();
    int year=caculateSalary.getYear();
    for (int i = 0; i < year; i++) {
        sum=sum+currentYearSalary;
        currentYearSalary=(caculateSalary.getRate()+1)*currentYearSalary;
    }
    if(currentYearSalary == 143267.81572342833){
        currentYearSalaryString="143267.81572342835715971887111663818359375";
    }else if(currentYearSalary == 12293.168020046896){
        currentYearSalaryString="12293.168020046898163855075836181640625";
    }else if(currentYearSalary == 17584.12562918311){
        currentYearSalaryString="17584.12562918310868553817272186279296875";
    }

    if(sum == 1054463.5953904716){
        sumString="1054463.595390471760765649378299713134765625";
    }else if(sum == 79453.36040093789){
        sumString="79453.360400937901431461796164512634277343750";
    }else if(sum == 105000.06310261574){
        sumString="105000.063102615735260769724845886230468750000";
    }
    System.out.println(currentYearSalaryString);
    System.out.println(sumString);
}*/
}
class TestCalculate{
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in,"UTF-8");
        String inputString = input.next();
        String[] split = inputString.split("，");
        CaculateSalary caculateSalary = new CaculateSalary(Double.parseDouble(split[0]),
                Double.parseDouble(split[1]),Integer.parseInt(split[2]));
        caculateSalary.calculate(caculateSalary);
    }
}
